<!doctype html>
<html>

<head>
  <title>自定义奖池</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="/yobot-depencency/vue@2.6.11/dist/vue.min.js"></script>
  <script src="/yobot-depencency/axios@0.19.2/dist/axios.min.js"></script>
</head>

<body>
  <p><a href="../">返回</a></p>
  <p>所有概率都是相对值，即：抽取率 = 当前奖池概率 ÷ 所有奖池总概率 </p>
  <div id="app">
    <div v-for="(pdata, pname) in settings.pool">
      <h2>奖池：[[pname]]</h2>
      <button @click="$delete(settings.pool, pname)">删除奖池</button><br />
      名称：<input v-model="pname" /><br />
      前缀：<input v-model="pdata.prefix" /><br />
      单抽概率：<input v-model.number="pdata.prop" /><br />
      保底抽概率：<input v-model.number="pdata.prop_last" /><br />
      内容:<br /><input v-for="(item, ikey) in pdata.pool" v-model="pdata.pool[ikey]" />
      <button @click="pdata.pool.push(null)">添加</button>
      <button @click="pdata.pool.pop()">删除</button>
    </div>
    <br /><br />
    <button @click="addpool">添加奖池</button>
    <br /><br /><br />
    <div>
      每次抽卡数：<input v-model.number="settings.settings.combo" /><br />
      每日抽卡次数：<input v-model.number="settings.settings.day_limit" /><br />
      <input type="checkbox" v-model.number="settings.settings.shuffle">保底抽位置不固定
    </div>
    <button @click="update">保存</button>
  </div>
</body>
<script>
  var api_path = "{{ url_for('yobot_pool_setting_api') }}";
  var csrf_token = "{{ session['csrf_token'] }}";
</script>
<script src="{{ url_for('yobot_static', filename='admin/pool-setting.js') }}"></script>

</html>